import { defineStore } from 'pinia'
import { constantRoutes } from '@/router'
import router from '@/router'

export const usePermissionStore = defineStore('permission', {
  state: () => ({
    routes: [],
    addRoutes: []
  }),

  actions: {
    generateRoutes() {
      return new Promise(resolve => {
        // 模拟异步获取路由
        setTimeout(() => {
          this.routes = constantRoutes
          resolve(constantRoutes)
        }, 100)
      })
    }
  }
})
